package logic

import (
	"github.com/gin-gonic/gin"
	"github.com/vueadmin/app/admin/internal/dto"
	"github.com/vueadmin/app/admin/internal/model"
	"github.com/vueadmin/app/admin/internal/service"
	"github.com/vueadmin/app/admin/internal/svc"
	"github.com/vueadmin/app/admin/internal/vo"
)

type linkcataLogic struct{
	ctx    *gin.Context
	svcCtx *svc.ServiceContext
}

func NewLinkcataLogic(ctx *gin.Context, svcCtx *svc.ServiceContext) *linkcataLogic {
	return &linkcataLogic{
		ctx: ctx,
		svcCtx: svcCtx,
	}
}

/**
 * @description(数据列表)
 * @buildcode(true)
*/
func (p linkcataLogic) GetPageList(req *dto.LinkcataPageReq) ([]*vo.LinkcataList, int64, error) {
	s := service.NewLinkcataService(p.svcCtx)
	return s.GetPageList(req)
}

/**
 * @description(修改排序开关)
 * @buildcode(true)
*/
func (p linkcataLogic) UpdateExt(req map[string]interface{}) error {
	s := service.NewLinkcataService(p.svcCtx)
	return s.UpdateExt(req)
}

/**
 * @description(添加)
 * @buildcode(true)
*/
func (p linkcataLogic) Add(req *dto.LinkcataAddReq) (int, error) {
	s := service.NewLinkcataService(p.svcCtx)
	return s.Add(req)
}

/**
 * @description(修改)
 * @buildcode(true)
*/
func (p linkcataLogic) Update(req *dto.LinkcataUpdateReq) error {
	s := service.NewLinkcataService(p.svcCtx)
	return s.Update(req)
}

/**
 * @description(获取修改详情)
 * @buildcode(true)
*/
func (p linkcataLogic) GetUpdateInfo(req *dto.LinkcataGetUpdateInfoReq) (*model.Linkcata, error) {
	s := service.NewLinkcataService(p.svcCtx)
	return s.GetUpdateInfo(req)
}

/**
 * @description(删除)
 * @buildcode(true)
*/
func (p linkcataLogic) Delete(req *dto.LinkcataDeleteReq) error {
	s := service.NewLinkcataService(p.svcCtx)
	return s.Delete(req)
}

/**
 * @description(查看详情)
 * @buildcode(true)
*/
func (p linkcataLogic) Detail(req *dto.LinkcataDetailReq) (*vo.LinkcataDetail, error) {
	s := service.NewLinkcataService(p.svcCtx)
	return s.Detail(req)
}

